﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ZK.Common;
using ZK.InterfaceServer;

namespace ZK.YHP_TransManage
{
    public partial class 煤管票 : Form
    {
        public 煤管票()
        {
            InitializeComponent();
        }
        Models.CMTM.CPReceiveM cPReceiveM = new Models.CMTM.CPReceiveM();
        private void button1_Click(object sender, EventArgs e)
        {
            ShowBlackBox.WriteLine("1 煤管票开始除皮");
            Models.CMTM.CpSendMM sendm = new Models.CMTM.CpSendMM()
            {
                mScaleNum = 1,
                mCard = "1",
                mCNumber = "陕A11122",
                mTare = (float)15
            };
             cPReceiveM = CMTServer.SendCP(sendm);
            ShowBlackBox.WriteLine("1 "+ cPReceiveM.errorMsg);
            if (cPReceiveM.errorCode != 0)
            {
                ShowBlackBox.WriteLine("3 煤管票除皮发送失败");
                return;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            ShowBlackBox.WriteLine("1 煤管票开始称重");
            Models.CMTM.WCXSSendM sendm2 = new Models.CMTM.WCXSSendM()
            {
                mCname = "sj",
                mSort = "面煤",
                mTarget = "陕西省,西安市,长安区",
                mCtype = "前四后八",
                mType = "面煤",
                uuid = cPReceiveM.uuid,
                mPrice = (float)333.2,
                mNt = (float)30,
                mGr = (float)45,
                mCNumber = "陕A11122"
            };

            var resMWCXS = CMTServer.SendWCXS(sendm2);
            ShowBlackBox.WriteLine("1 " + resMWCXS.errorMsg);
            if (resMWCXS.errorMsg != "OK")
            {
                ShowBlackBox.WriteLine("3 境外票完成销售上传失败！");
                return;
            }
        }
    }
}
